package com.linkedbear.mybatis.encapsulate.c_extra.annotation.query;

import java.lang.annotation.Documented;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target(ElementType.FIELD)
public @interface Like {
    
    LikeType type() default LikeType.FULL;
    
    
    enum LikeType {
        FULL("'%', #, '%'"), LEFT("'%', #"), RIGHT("#, '%'");
        
        private String pattern;
    
        LikeType(String pattern) {
            this.pattern = pattern;
        }
    
        public String getPattern() {
            return pattern;
        }
    }
}
